package com.project.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;

/**
 * @Author(王思翰)
 * @Description(类的描述)应用控制器
 * @Date(创建时间) 2021/7/20 15:28
 */
@Controller
public class TestController {
    //客户端以/mytest请求，由当前方法处理
    @RequestMapping("/mytest")
    public String test(){
        System.out.println("测试方法");
        //设置跳转路径
        return "redirect:/html/index.html";
    }

//    @RequestMapping("/add")
//    public void add(UserBean userBean, //按照表单名和属性名相同的原则，将表单数据封装为实体对象
//                    @RequestParam("code") String code, //如果表单名和形参名不一样，加上@RequestParam("")说明那个表单值填充当前形参
//                    LocalDate birthday,
//                    HttpServletResponse response,
//                    HttpServletRequest request)throws Exception{
//        response.setContentType("text/html;charset=utf-8");
//        response.getWriter().println(userBean+"   code"+code);
//        response.getWriter().println(birthday);
//    }
}
